//
//  ClassAttendanceVC.m
//  SchoolTask
//
//  Created by feel on 16/8/25.
//  Copyright © 2016年 sm. All rights reserved.
//

#import "ClassAttendanceVC.h"
#import "ClassAttendance.h"
#import "ClassAttendanceCell.h"
#import "AskLeaveVC.h"


@interface ClassAttendanceVC ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic,retain) UITableView *tableView;
@end

@implementation ClassAttendanceVC

- (void)viewDidLoad {
    [super viewDidLoad];

    CGFloat w = 414 / kScreenW;
    CGFloat h = 736 / kScreenH;
    self.view.frame = [UIScreen mainScreen].bounds;
    ClassAttendance *class = [[ClassAttendance alloc]init];
    CGRect rect = [UIScreen mainScreen].bounds;

    _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 220/h, rect.size.width, self.view.frame.size.height-220/h)];
    [_tableView registerNib:[UINib nibWithNibName:@"ClassAttendanceCell" bundle:nil] forCellReuseIdentifier:@"cell"];
    [self.view addSubview:class];
    [self.view addSubview:_tableView];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 20;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    ClassAttendanceCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    [cell setLabel];
    cell.selectionStyle = NO;
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 70;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
